Page({
	data: {
		showList: []
	},
	onLoad: function(options) {
		// 生命周期函数--监听页面加载
		this.getAllList();
	},
	getAllList: function() {
		wx.showLoading({
			title: '加载中',
		})
		console.log('加载中');
		var _self = this;
		wx.request({
			url: getApp().globalData.otherUrl + '/que/investigation/queryInvestigation',
			method: 'POST',
			success: function(res) {
				console.log(res)
				wx.hideLoading();
				if (res.data.code == 1) {
					var arr = [];
					for (var i = 0; i < res.data.data.length; i++) {
						if (res.data.data[i].status == 1) {
							arr.push(res.data.data[i])
						}
					}

					_self.setData({
						showList: arr
					})

				} else {
					wx.showToast({
						title: '问卷正在发布中，请您稍后在进来看',
						icon: 'none',
						duration: 4000
					})

				}
			}
		})
	},
	turnAction: function(e) {
		console.log(e.target.dataset.code)
		wx.navigateTo({
			url: '../investigationDetail/investigationDetail?code=' + e.target.dataset.code
		})

	}
})